export default ({ request }) => ({
  /**
   * @description 登录
   * @param {Object} data
   */
  USER_LOGIN(data = {}) {
    return request({
      url: "/data/v1/login",
      method: "post",
      data: data,
    });
  },

  /**
   * @description 注册
   * @param {Object} data
   */
  USER_REGISTER(data = {}) {
    return request({
      url: "/data/v1/register",
      method: "post",
      data: data,
    });
  },

  /**
   * @description 注册
   * @param {Object} data
   */
  GET_CODE(data = {}) {
    return request({
      url: "/data/v1/verificationCode",
      method: "post",
      data: data,
    });
  },
  // 上传图片
  UPLOAD(file) {
    let formData = new FormData();
    formData.append("images", file);

    return request({
      url: "https://platform.dddbh.com/data/v1/imagesFileUpload",
      method: "post",
      headers: { "Content-Type": "multipart/form-data" },
      data: formData,
    });
  },

  /**
   * @description 验证TOKEN
   * @param {Object} data
   */
  CHECK_TOKEN(data = {}) {
    return request({
      url: "/data/v1/tokenverification",
      method: "post",
      data: data,
    });
  },
});
